3.84 \(\int \cosh (c+d x) (a+b \tanh ^2(c+d x)) \, dx\)

Optimal. Leaf size=27 \[ \frac{(a+b) \sinh (c+d x)}{d}-\frac{b \tan ^{-1}(\sinh (c+d x))}{d} \]

[Out]

-((b*ArcTan[Sinh[c + d*x]])/d) + ((a + b)*Sinh[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0319431, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.158, Rules used = {3676, 388, 203} \[ \frac{(a+b) \sinh (c+d x)}{d}-\frac{b \tan ^{-1}(\sinh (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[c + d*x]*(a + b*Tanh[c + d*x]^2),x]

[Out]

-((b*ArcTan[Sinh[c + d*x]])/d) + ((a + b)*Sinh[c + d*x])/d

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rule 388

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*x*(a + b*x^n)^(p + 1))/(b*(n*
(p + 1) + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cosh (c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+(a+b) x^2}{1+x^2} \, dx,x,\sinh (c+d x)\right )}{d}\\ &=\frac{(a+b) \sinh (c+d x)}{d}-\frac{b \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\sinh (c+d x)\right )}{d}\\ &=-\frac{b \tan ^{-1}(\sinh (c+d x))}{d}+\frac{(a+b) \sinh (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0289552, size = 47, normalized size = 1.74 \[ \frac{a \sinh (c) \cosh (d x)}{d}+\frac{a \cosh (c) \sinh (d x)}{d}+\frac{b \sinh (c+d x)}{d}-\frac{b \tan ^{-1}(\sinh (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[c + d*x]*(a + b*Tanh[c + d*x]^2),x]

[Out]

-((b*ArcTan[Sinh[c + d*x]])/d) + (a*Cosh[d*x]*Sinh[c])/d + (a*Cosh[c]*Sinh[d*x])/d + (b*Sinh[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.034, size = 37, normalized size = 1.4 \begin{align*}{\frac{a\sinh \left ( dx+c \right ) }{d}}+{\frac{b\sinh \left ( dx+c \right ) }{d}}-2\,{\frac{b\arctan \left ({{\rm e}^{dx+c}} \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(d*x+c)*(a+b*tanh(d*x+c)^2),x)

[Out]

a*sinh(d*x+c)/d+b*sinh(d*x+c)/d-2/d*b*arctan(exp(d*x+c))

________________________________________________________________________________________

Maxima [B]  time = 1.60957, size = 74, normalized size = 2.74 \begin{align*} \frac{1}{2} \, b{\left (\frac{4 \, \arctan \left (e^{\left (-d x - c\right )}\right )}{d} + \frac{e^{\left (d x + c\right )}}{d} - \frac{e^{\left (-d x - c\right )}}{d}\right )} + \frac{a \sinh \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*b*(4*arctan(e^(-d*x - c))/d + e^(d*x + c)/d - e^(-d*x - c)/d) + a*sinh(d*x + c)/d

________________________________________________________________________________________

Fricas [B]  time = 1.86466, size = 296, normalized size = 10.96 \begin{align*} \frac{{\left (a + b\right )} \cosh \left (d x + c\right )^{2} + 2 \,{\left (a + b\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) +{\left (a + b\right )} \sinh \left (d x + c\right )^{2} - 4 \,{\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right )\right )} \arctan \left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right ) - a - b}{2 \,{\left (d \cosh \left (d x + c\right ) + d \sinh \left (d x + c\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*((a + b)*cosh(d*x + c)^2 + 2*(a + b)*cosh(d*x + c)*sinh(d*x + c) + (a + b)*sinh(d*x + c)^2 - 4*(b*cosh(d*x
 + c) + b*sinh(d*x + c))*arctan(cosh(d*x + c) + sinh(d*x + c)) - a - b)/(d*cosh(d*x + c) + d*sinh(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \cosh{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*cosh(c + d*x), x)

________________________________________________________________________________________

Giac [B]  time = 1.265, size = 76, normalized size = 2.81 \begin{align*} -\frac{4 \, b \arctan \left (e^{\left (d x + c\right )}\right ) +{\left (a + b\right )} e^{\left (-d x - c\right )} -{\left (a e^{\left (d x + 4 \, c\right )} + b e^{\left (d x + 4 \, c\right )}\right )} e^{\left (-3 \, c\right )}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(d*x+c)*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

-1/2*(4*b*arctan(e^(d*x + c)) + (a + b)*e^(-d*x - c) - (a*e^(d*x + 4*c) + b*e^(d*x + 4*c))*e^(-3*c))/d